﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using YZJOSM.Utility;

namespace YZJOSM.Models
{
    internal class TankNameMapping
    {
        public int Id { get; set; }
        public string tankName { get; set; }
        public static List<TankNameMapping> GetBatchNameBasesListAll(string sql)
        {
            List<TankNameMapping> tankNameBases = new List<TankNameMapping>();
            DataTable dt = SQLHelper.ExecuteDataTable(sql);
            foreach (DataRow dr in dt.Rows)
            {
                tankNameBases.Add(dr.DataRowToModel<TankNameMapping>());//反射
            }
            return tankNameBases;
        }
    }

    internal class SqNameMapping
    {
        public int Id { get; set; }
        public string SQName { get; set; }
        public static List<SqNameMapping> GetBatchNameBasesListAll(string sql)
        {
            List<SqNameMapping> sqNameBases = new List<SqNameMapping>();
            DataTable dt = SQLHelper.ExecuteDataTable(sql);
            foreach (DataRow dr in dt.Rows)
            {
                sqNameBases.Add(dr.DataRowToModel<SqNameMapping>());//反射
            }
            return sqNameBases;
        }
    }

    internal class MaterialNameMapping
    {
        public int Id { get; set; }
        public string materialName { get; set; }
        public static List<MaterialNameMapping> GetBatchNameBasesListAll(string sql)
        {
            List<MaterialNameMapping> materialNameBases = new List<MaterialNameMapping>();
            DataTable dt = SQLHelper.ExecuteDataTable(sql);
            foreach (DataRow dr in dt.Rows)
            {
                materialNameBases.Add(dr.DataRowToModel<MaterialNameMapping>());//反射
            }
            return materialNameBases;
        }
    }

    public class BatchBases
    {
        public string reportname { get; set; }
        public int reportType { get; set; }

        public static List<BatchBases> GetBatchNameBasesListAll(string sql)
        {
            List<BatchBases> batchBases = new List<BatchBases>();
            DataTable dt = SQLHelper.ExecuteDataTable(sql);
            foreach (DataRow dr in dt.Rows)
            {
                batchBases.Add(dr.DataRowToModel<BatchBases>());//反射
            }
            return batchBases;
        }
    }

}
